<?php

/*
 * C端公众号功能
 */

namespace Home\Controller;

use Think\Controller;
use Think\C_Controller;

class OrderController extends C_Controller {

    public function __construct() {
        parent::__construct();
    }
    
    /*查询用户订单*/
    public function index(){
        $orders = new \Home\Logic\OrderLogic();
        $User_id = $_SESSION['client_id'];
        
        $user_orders = $orders->getUserOrderByUserId($user_id, 0);
        
        $this->assign('user_orders',$orders);
        $this->display('order');
    }
    
    /*查询用户订单*/
    public function appendOrders(){
        $orders = new \Home\Logic\OrderLogic();
        $User_id = $_SESSION['client_id'];
        $start = (int)$_GET['start'];
        
        $user_orders = $orders->getUserOrderByUserId($user_id, $start);
        if(count($user_orders)<1){
            exit('false');
        }
        exit(json_encode($user_orders));
    }
    
}